package com.thon.dao.user.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.thon.dao.user.UserSettingDao;
import com.thon.dao.util.AbstractDao;
import com.thon.entity.user.UserSetting;

/**
 * @file UserSettingDaoImpl.java
 * @author Zemo
 * @mail zemochen@gmail.com
 * @data 2014年1月3日 下午6:24:33
 * @description: TODO
 */
@Repository
public class UserSettingDaoImpl extends AbstractDao<UserSetting> implements UserSettingDao  {

	public UserSettingDaoImpl() {
		super(UserSetting.class);
	}

	@Override
	public List<UserSetting> getUserSettingByUserId(Integer userId) {
		
		String queryString = "FROM UserSetting WHERE userId=?";
		return findList(queryString, null, userId);
	}

	@Override
	public Boolean SettingStatus(Integer uid, String metaKey) {
		String queryString = "from UserSetting where userId = ? and metaKey=? and metaValue = 1";
		if (findOne(queryString, null, uid,metaKey) != null) {
			return true;
		}else {
			return false;
		}
		
	}


}
